home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Readers / Gui4Cli / Docs / Tutorials / Clock.gc < prev    next >
Text File  |  1997-12-02  |  2KB  |  81 lines

  1. G4C
  2.  
  3. ; Clock.gc
  4. ; ============================================================
  5. ; This gui works together with the Clock.rexx Arexx script
  6. ; which is also in this directory - You must also read that
  7. ; to get the full picture.
  8.  
  9. ; Note that if you really want to implement one or more clocks
  10. ; in your guis, you should use the Guis:tools/rtn/Clock.g 
  11. ; routine - see it's explanation in the Docs/Routines.guide
  12. ; ============================================================
  13.  
  14.  
  15. WINBIG -1 -1 304 26 'ARexx-Gui4Cli Clock'
  16. BOX 0 0 0 0 out button        ; decorative border
  17.  
  18.  
  19. ; ============================================================
  20. ; Upon loading, we make sure that rexxmast is available, then
  21. ; we launch the rexx program that will set our variables and
  22. ; wake us up every minute, so we can refresh the display.
  23. ; ============================================================
  24.  
  25. xOnLoad
  26.  
  27. ; look for arexx and if not found, launch it..
  28. ifexists port AREXX
  29.    ; ok..
  30. else
  31.    cli 'rexxmast'
  32.    wait port AREXX 30
  33.    if $$retcode > 0
  34.       ezreq 'Could not launch RexxMast!' Quit ''
  35.       guiquit clock.gc
  36.       stop
  37.    endif
  38. endif
  39.  
  40. ; Look for the Clock.rexx program, in the same directory
  41.  
  42. extract clock.gc guipath path
  43. joinfile $path Clock.rexx rexxprog
  44.  
  45. ; Open the gui and start up the rexx program
  46.  
  47. GuiOpen Clock.gc
  48. sendrexx AREXX '$rexxprog clock.gc update'
  49.  
  50.  
  51. ; ============================================================
  52. ; On closing the gui, quit. The ARexx program we launched will 
  53. ; quit on it's own when it wakes up and doesn't find us..
  54. ; ============================================================
  55.  
  56. xOnClose
  57. guiquit Clock.gc
  58.  
  59.  
  60. ; ============================================================
  61. ; This is the gadget that shows the time, date etc
  62. ; ============================================================
  63.  
  64. TEXT 7 5 290 16 "" 100 BOX
  65. gadfont opal.font 12 000    ; change the font here
  66. gadtxt center
  67. gadid 1
  68.  
  69.  
  70. ; ============================================================
  71. ; This is the routine that the rexx program we launched will
  72. ; call every minute, after it has set our variables.
  73. ; We use it to update the above text gadget.
  74. ; ============================================================
  75.  
  76. XRoutine update
  77. update clock.gc 1 "$time - $day\, $date"
  78.  
  79.  
  80.  
  81.